-
-
Notifications
You must be signed in to change notification settings - Fork 606
fix(pypi): only generate namespace package shims if implicit namespaces are disabled #3059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
aignas
merged 4 commits into
bazel-contrib:main
from
rickeylev:fix.enable.namespace.pkgs
Jul 6, 2025
Merged
fix(pypi): only generate namespace package shims if implicit namespaces are disabled #3059
aignas
merged 4 commits into
bazel-contrib:main
from
rickeylev:fix.enable.namespace.pkgs
Jul 6, 2025
+22
−2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
note to self:
|
aignas
approved these changes
Jul 6, 2025
In order to unblock this I modified the unit test to set the flag to disable the consumption of the glob. |
aignas
reviewed
Jul 6, 2025
Thanks for catching this and digging until the end! |
aignas
added a commit
that referenced
this pull request
Jul 6, 2025
…es are disabled (#3059) The refactoring to move the pkgutil shim generation to build phase inverted the logic for when it should be activated. When `enable_implicit_namespace_pkgs=True`, it means to not generate the pkgutil shims ("respect the Python definition of the namespace package"). To fix, just invert the logic that activates it. A test will be added in a subsequent PR because the necessary helper isn't in the 1.5 branch. Fixes #3038 --------- Co-authored-by: Ignas Anikevicius <[email protected]> (cherry picked from commit 47c681b)
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jul 7, 2025
This adds functional tests for the generated pkgutil namespace files. The test works by creating two wheels with the necessary structure: * An `__init__.py` file isn't in the wheel for the namespace package * They are both part of the namespace package. * The test verifies both are importable. These are the tests for #3059
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The refactoring to move the pkgutil shim generation to build phase inverted
the logic for when it should be activated. When
enable_implicit_namespace_pkgs=True
, it means to not generate the pkgutil shims("respect the Python definition of the namespace package").
To fix, just invert the logic that activates it.
A test will be added in a subsequent PR because the necessary helper isn't
in the 1.5 branch.
Fixes #3038